package cn.lijiajia3515.cairo.security.web.authentication;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.security.authentication.event.AuthenticationSuccessEvent;
import org.springframework.security.core.Authentication;

/**
 * 认证成功 日志通知 对象
 */
@Slf4j
public class CairoLogAuthenticationEventListener {

	@EventListener(AuthenticationSuccessEvent.class)
	public void authenticationSuccessListener(AuthenticationSuccessEvent event) {
		Authentication authentication = event.getAuthentication();
		log.debug("authentication success : {}", authentication.getPrincipal());
	}


}
